#include "dynamiclargelistmodel.h"

DynamicLargeListModel::DynamicLargeListModel(QObject *parent)
    : QAbstractListModel(parent)
{
}

void DynamicLargeListModel::addItem(const QString &title)
{
    const int index = itemCount;
    beginInsertRows(QModelIndex(), index, index);
    titles.append(title);
    checkedItems.insert(index, false);
    itemCount++;
    endInsertRows();

}

int DynamicLargeListModel::rowCount(const QModelIndex &parent) const
{
    if (parent.isValid())
        return 0;

    return itemCount;
}

QVariant DynamicLargeListModel::data(const QModelIndex &index, int role) const
{
    if (!index.isValid() || index.row() >= itemCount || index.row() < 0) {
                return QVariant();
     }

    // FIXME: Implement me!
    return QVariant();
}
